Added edge case behavior testing for math bruteforce#2665
Added edge case behavior testing for math bruteforce#2665shajder wants to merge 7 commits intoKhronosGroup:mainfrom
Conversation
|
|
||
| static const AbstractEdgeCase edge_case_table[] = { | ||
|
|
||
| { "acospi", { ONE }, POS_ZERO }, |
There was a problem hiding this comment.
This table only covers the cases listed in the OpenCL C specification as fas as I can tell? Should we also check for the cases from Section F.9 of the C99 Specification? I'd suggest keeping the OpenCL and C99 lists somehow distinct (i.e., not interleaved).
There was a problem hiding this comment.
Certainly we should support half_ versions. As for the rest I would appreciate WG expertise.
There was a problem hiding this comment.
moreover, this discussion may be relevant
|
|
||
| { | ||
| std::array<uint8_t, CL_VALUE_MAX_BYTES> result{}; | ||
| static std::vector<uint8_t> result; |
There was a problem hiding this comment.
To avoid continuous allocations/deallocations, the vector retains its capacity between calls so resize() does not reallocate as long as the size stays within the previously allocated capacity.
There was a problem hiding this comment.
The potential benefit here looks marginal in the bigger scheme of things, and I don’t think it outweighs the readability/maintainability cost of introducing hidden persistent state. So I would encourage dropping static.
There was a problem hiding this comment.
Done, working buffers turned into class members.
| err = | ||
| clEnqueueWriteBuffer(queue, buf, CL_TRUE, 0, ec.inputs[i].byte_size, | ||
| ec.inputs[i].data.data(), 0, nullptr, nullptr); | ||
| static std::vector<uint8_t> inData; |
Fixes #2641